package com.cloudbroker.openapi.manage.controller;

import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.user.back.CustomerModelBack;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.user.back.LeaderModelBack;
import com.cloudbroker.bcs.platform.ltb.bizapi.service.user.vo.UserModelQueryForm;
import com.cloudbroker.bcs.platform.ltb.bizapi.t2service.business.UserModelT2BizService;
import com.cloudbroker.bcs.platform.ltb.bizexport.t2.business.UserModelT2;
import com.cloudbroker.bcs.platform.ltb.common.ext.annotation.SaveLog;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import static com.cloudbroker.bcs.platform.ltb.common.util.RequestUtil.getSingleParameterMapForBody;


/**
 * Created by world on 16/11/22.
 */
@Controller
public class UserModelController {

    @Resource
    private UserModelT2BizService userModelT2BizService;

    @ResponseBody
    @RequestMapping("/manage/customer_model_qry")
    @SaveLog(remark = "粉丝")
    public CustomerModelBack customerModel(HttpServletRequest request, String jsonpcallback){
        UserModelQueryForm form = getSingleParameterMapForBody(request , UserModelQueryForm.class);
        return VOUtil.setJsonpResult(userModelT2BizService.funcCustomerModel(form), jsonpcallback);
    }

    @ResponseBody
    @RequestMapping("/manage/leader_model_qry")
    @SaveLog(remark = "投顾")
    public LeaderModelBack leaderModel(HttpServletRequest request, String jsonpcallback){
        UserModelQueryForm form = getSingleParameterMapForBody(request , UserModelQueryForm.class);
        return VOUtil.setJsonpResult(userModelT2BizService.funcLeaderModel(form), jsonpcallback);
    }
}
